<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>创建地图</title>
    <!--引入需要的js和css-->
    <link rel="stylesheet" href="https://www.dituyi.com/wmap/wmap.css">
    <script src="https://www.dituyi.com/wmap/wmap.js"></script>
    <script src="https://www.dituyi.com/wmap/config.js"></script>
    <style>
        html, body {
            width: 100%;
            height: 100%;
            margin: 0;
        }

        .panel {
            margin-bottom: 0px;
        }

        .panel-body {
            padding: 8px;
        }

        #mapDiv {
            height: calc(100vh - 18px);
        }
    </style>
</head>
<body>
<div class="panel panel-default">
    <div class="panel-body">
        <div id="mapDiv">
        </div>
    </div>
</div>
<script>
    //创建地图对象
    map = W.map("mapDiv");
    //创建一个底图，并添加到map中
    var tileServiceUrl = "http://t0.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=3dd6d4437c88b9652fad87613f089185";
    var baseLayer = W.tileLayer(tileServiceUrl).addTo(map);
    //设置地图显示的中心点和级别
    map.setView([17.692436998627272, 107.91046142578126], 7);


    //ImageOverlay方式添加
   /* imageBounds = [[ 15.241960525512695,105.225],[ 30.90781593322754,114.99167]];
    var imageUrl = 'http://localhost:9001/leaflet/map/getmappng1?action=getImage&t='+performance.now()
    W.imageOverlay(imageUrl, imageBounds).addTo(map);*/

    //  var imageUrl = 'http://localhost:8080/hello?action=getImageWithBounds&minLon=106&maxLon=110&minLat=16&maxLat=20',imageBounds = [[ 16,106], [ 20,110]];
    //  W.imageOverlay(imageUrl, imageBounds).addTo(map);

</script>
</body>
</html>